
package com.example.idlefish.GoodsInfo.ActivityContract

import android.app.Activity
import android.content.Context
import android.content.Intent
import androidx.activity.result.contract.ActivityResultContract
import com.example.idlefish.GoodsInfo.GoodContentActivity

class GooddResultContract:ActivityResultContract<Long, Boolean>() {
    override fun createIntent(context: Context, input: Long): Intent {
        val intent = Intent(context, GoodContentActivity::class.java)
        intent.putExtra("goodId", input)
        return intent
    }

    override fun parseResult(resultCode: Int, intent: Intent?):Boolean {
        if(resultCode != Activity.RESULT_OK || intent == null)
        {
            return false
        }
        return true
    }
}
